import { init } from 'snabbdom/build/package/init'
import { h } from 'snabbdom/build/package/h'

const patch = init([])

let vnode = h('div#container', [
    h('h1', 'hello snabbdom'),
    h('p', 'this is p 标签')
])
let app = document.querySelector('#app')

let oldVDom = patch(app, vnode)
setTimeout(() => {
    // vnode = h('div#container', [
    //     h('h1', 'this is h1'),
    //     h('p', 'this is p')
    // ])
    //
    // patch(oldVDom, vnode)

    // 清空vnode节点
    patch(oldVDom, h('!'))
}, 2000)
